<template>
    <div class="flex_x fx_row">
        <el-row class="tac" >
            <el-col :span="12" style="width:210px"> 
            <el-menu
            style="height:720px"
            default-active="2"
            class="el-menu-vertical-demo"
            collapse-transition=true
            @open="handleOpen"
            @close="handleClose"
            background-color="lightblue"
            text-color="#fff"
            active-text-color="#ffd04b">
            <el-submenu index="1">
                <template slot="title">
                <i class="el-icon-location"></i>
                <span>用户基本操作</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item index="select" @click="chose">查找书籍</el-menu-item>
                    <el-menu-item index="borrow" @click="chose">借书</el-menu-item>
                    <el-menu-item index="1-3">还书</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
                <template slot="title">
                <i class="el-icon-menu"></i>
                <span>导航二</span>
                </template>
                <el-menu-item-group>
                <el-menu-item index="1-1">选项1</el-menu-item>
                <el-menu-item index="1-2">选项2</el-menu-item>
                <el-menu-item index="1-3">选项3</el-menu-item>
                <el-menu-item index="1-4">选项4</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-menu-item index="3" disabled>
                <i class="el-icon-document"></i>
                <span slot="title">导航三</span>
            </el-menu-item>
            <el-menu-item index="4">
                <i class="el-icon-setting"></i>
                <span slot="title">导航四</span>
            </el-menu-item>
            </el-menu>
        </el-col>
        </el-row>
        <div style="width:100%">
            <div style="height:35px;font-size:45px" class="flex_x fx_ac">
                <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/loading' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item><a href="/">用户基本操作</a></el-breadcrumb-item>
                <el-breadcrumb-item>查询</el-breadcrumb-item>
                </el-breadcrumb>
            </div>
            <div class="right">
                <Demo v-if="choseIndex=='0-0'"></Demo>
                <Select v-if="choseIndex=='select'"></Select>
                
                <Borrow v-if="choseIndex=='borrow'"></Borrow>
                </div>
        </div>
        
    </div>
</template>
<script>
import Select from './select.vue'
import Demo from './demo.vue'
import Borrow from './borrow.vue'
export default {
    components:{
        Select,Demo,Borrow
    },
    data(){
        return{
            choseIndex:'0-0',
        }
    },
    mounted(){

    },
    methods:{
        handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
        handleClose(key, keyPath) {
                console.log(key, keyPath);
            },
        chose(val){
            console.log(val.index);
            this.choseIndex=val.index
        }
    }
}
</script>
<style scoped>
.right{
    width: 100%;
    height: 685px;
    /* background-color: royalblue; */
}
.flex_x{
    display: flex;
}
.fx_row{
    flex-direction: row;
}
.fx_c{
    flex-direction: column;
}
.fx_ac{
    align-items: center;
}
.fx_pc{
    justify-content: center;
}
.fx_sa{
    justify-content: space-around;
}
</style>